home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
114_01
/
guide.doc
< prev
next >
Wrap
Text File
|
1987-07-13
|
21KB
|
823 lines
.cm screen editor: user guide
.cm source: guide.doc
.he 'guide.doc''September 8, 1981'
.fo ''-#-''
.ul
Basic terms
The terms, mode, command, special character,
prompt line, cursor, the current line, and the buffer
are used extensively in this documentation.
You will learn about the screen editor more easily if you
become familiar with these terms.
Let's look at each in turn.
.ti +3
The screen editor is comprised of several
.ul
modes.
You can switch between modes,
but the editor can't be in two modes at the same time.
The editor behaves differently in each mode,
so you use each mode to do a particular type
of editing.
.ti +3
There are three modes:
edit mode, command mode and insert mode.
You use edit mode for making
small changes in many different lines.
Command mode is used for making larger
(hence potentially more dangerous)
changes to the whole file you are editing.
You must be in command mode to do anything
that will change files on the disk.
You use insert mode for making a series of
insertions into the text.
First drafts are often entered in this mode.
.ti +3
You use
.ul
commands
to make things happen in each mode.
Which commands you can use depends on what mode you
are in.
Do not confuse the terms "commands" and
"command mode".
Every mode has a set of commands which
you can use in that mode.
Command mode has its own set of commands.
.ti +3
.ul
Special characters
are one-letter commands.
Special characters must be control keys, so
you can use these commands in places where the
editor might not otherwise expect a command.
.ti +3
The
.ul
prompt line
is the top line of the screen.
It tells you things like what line you
are editing and what mode you are in.
If you get confused about what mode you are in
you can always glance at the prompt line
and get your bearings.
.ti +3
Several edit-mode commands
consist of two or more letters.
These edit-mode commands are called
.ul
extended commands.
After you type the first letter of such a command,
but before you type the last letter, the
prompt line will indicate that you must type one more
letter to finish the extended command.
For example,
after you type an "s" to enter the edit-mode search command
the prompt line's mode field will contain
'edit: search'.
.ti +3
The
.ul
cursor
is a distinctive character on the screen.
On most video terminals
this marker is a character shown with reverse
video.
In command mode you always type commands on the bottom
line so the cursor is always on the bottom line.
In edit mode and insert mode
the cursor is always on the current line.
.ti +3
The
.ul
current line
is the only line you can edit.
In command mode the current line may not be shown on
the screen, but in edit and insert modes
the current line is shown and it contains the cursor.
If you want to make a change to a line you must first
move the cursor to that line.
.ti +3
The
.ul
buffer
is a part of the computer's storage which holds the file
you are editing.
In order to edit a disk file, you must first read the disk
file into the buffer using the load command.
As you edit the file the changes you make are made only
to the buffer, not to your disk file.
Before you end your editing session you must copy the buffer
back to a disk file using the save or resave commands.
The editor keeps track of whether you have done this;
it won't let you forget to save your work.
.ti +3
The
.ul
window
is a part of the screen which shows a portion
of the buffer.
In edit and insert modes the window fills all of
the screen except the prompt line.
You can think of the file as a scroll of parchment which
unwinds under the window as you move the cursor.
The window is not shown in command mode.
.ti +3
Now let's look more closely at the editor's commands.
We'll start with special characters, which are commands
that may be used in either insert or edit modes.
Then we will look at other commands which are unique to
a particular mode.
.ul
Special Characters
.ti +3
Special characters act the same in all modes.
Special characters must be control characters so that
the editor may always distinguish special characters from
regular text.
.ti +3
There are 14 special characters;
all 14 may be used in either edit mode or insert mode.
Only a few may be used in command mode.
.ti +3
You can use the configuration program to choose
which keys on your keyboard to use for each
special character.
Thus, I won't be able to
be specific about what key on your keyboard you will actually
hit in order to type, for instance, the down key.
I'll often refer to special characters as special keys;
for example, I'll call the down special character the
down key.
.ti +3
The
.ul
left and right keys
just move the cursor.
They do not cause changes to lines.
These keys are always "anchored" to the current line;
you can't move off the current line by using these keys.
If you hit the right key while the cursor
is at the right margin,
nothing will happen.
Similarly, nothing will happen if you hit the
left key while the cursor is at the left margin.
.ti +3
The
.ul
up and down keys
move the cursor up and down
on the screen.
You can't move the cursor above line 1 of the file, nor can you
move the cursor below the last line of the file.
Both these keys also switch the editor to edit mode.
.ti +3
The
.ul
insert up key
inserts a blank line above the current line
while the
.ul
insert down key
inserts a blank line below the current line.
Both these keys also switch the editor to insert mode.
.ti +3
The
.ul
delete character key
deletes the character to the left of the cursor.
This key is anchored to the current line;
nothing is deleted if the cursor is at the left margin.
The
.ul
delete line key
deletes the entire line on which the cursor rests.
.ti +3
The
.ul
undo key
always undoes whatever
editing you have done on the current line since
the last time the cursor came to the current line.
.ti +3
The
.ul
insert key
switches the editor to insert mode.
Similarly, the
.ul
command key
switches the editor to command mode and the
.ul
edit key
switches the editor to edit mode.
.ti +3
The
.ul
split key
splits the current line into two pieces.
Everything to the left of the cursor stays right where it is.
All other characters are moved from the current line to
a new line which is created below the original line.
.ti +3
The
.ul
join key
is the opposite of the split key;
it combines two lines into one line.
The join key appends the current line to the line above it,
then deletes the lower line.
.ul
Edit Mode
.ti +3
Edit-mode commands are normal letters; you don't need
to use special keys.
This speeds typing.
You can, however, use the special keys in edit mode if you
want to.
.ti +3
Besides the special characters you can use
the following one-letter edit-mode commands:
space, b, c, d, e, g, i, k, s, u, and x.
These letters stand for
begin, command, down, end, go, insert, kill,
search, up, and eXchange.
Note that all these commands may be typed either
in upper case or in lower case.
Letters which are neither edit-mode commands
nor special keys are simply ignored.
The following paragraphs explain what these
commands do in greater detail.
.ti +3
The
.ul
space bar
moves the cursor right one column.
Nothing happens if the cursor is already
on the rightmost column of the screen.
.ti +3
The
.ul
b command
puts the cursor at the beginning
(left hand margin) of the line.
.ti +3
The
.ul
c command
switches the editor to command mode.
.ti +3
The
.ul
d command
causes the cursor to move down rapidly.
The cursor keeps moving until it reaches the last line
of the file or until you type any key.
.ti +3
The
.ul
e command
moves the cursor to the right end of the line.
.ti +3
The
.ul
i command
switches the editor to insert mode.
.ti +3
The
.ul
g command
moves the cursor to another line.
The g command is an extended command;
after you type the g the curso